<template>
  <el-dialog :title="title" :visible="visible" @close="close">
    <el-form
      ref="form"
      :model="entityData"
      :rules="rules"
      label-width="120px"
      label-position="right"
      style="width:90%;margin:0px auto;"
    >
      <!--表单区域 -->

      <el-form-item label="单据名称" prop="name">
        <el-input v-model="entityData.name" :readonly="readonly" />
      </el-form-item>
      <el-form-item label="单据编码" prop="code">
        <el-input v-model="entityData.code" :readonly="readonly" />
      </el-form-item>
      <el-form-item label="前缀" prop="prefix">
        <el-input v-model="entityData.prefix" :readonly="readonly" />
      </el-form-item>
      <el-form-item label="日期" prop="datePart">
        <el-input v-model="entityData.datePart" :readonly="readonly" />
      </el-form-item>
      <el-form-item label="流水号长度" prop="length">
        <el-input v-model="entityData.length" :readonly="readonly" />
      </el-form-item>
      <el-form-item label="连接符" prop="connectors">
        <el-input v-model="entityData.connectors" :readonly="readonly" />
      </el-form-item>
      <el-form-item label="当前流水号" prop="serialNo">
        <el-input v-model="entityData.serialNo" :readonly="readonly" />
      </el-form-item>
      <el-form-item label="重置策略" prop="resetStrategy">
        <dictionary-radio-group
          v-model="entityData.resetStrategy"
          :code="constant.SERIAL_NO_RESET_STATEGY"
          :readonly="readonly"
        />
      </el-form-item>
      <el-form-item label="备注" prop="remark">
        <el-input v-model="entityData.remark" :readonly="readonly" />
      </el-form-item>
      <el-form-item label="排序号" prop="orderNo">
        <el-input v-model="entityData.orderNo" :readonly="readonly" />
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button v-show="saveButtonVisible" type="primary" @click="save">保存</el-button>
      <el-button @click="close">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { detailMixin } from '@/mixin/detailMixin'
const MODULE_CODE = 'support'
const ENTITY_TYPE = 'serialNo'
export default {
  name: ENTITY_TYPE + '-detail',
  mixins: [detailMixin],
  data() {
    return {
      entityType: ENTITY_TYPE,
      moduleCode: MODULE_CODE,
      // eslint-disable-next-line no-eval
      api: eval('this.$api.' + MODULE_CODE + '.' + ENTITY_TYPE),
      pageCode: MODULE_CODE + ':' + ENTITY_TYPE + ':',
      entityData: {

      },
      rules: {
        // 前端验证规则
        name: [
          { required: true, message: '请输入单据名称', trigger: 'blur' }
        ],
        code: [
          { required: true, message: '请输入单据编码', trigger: 'blur' }
        ],
        length: [
          { required: true, message: '请设置流水号长度', trigger: 'blur' }
        ],
        resetStrategy: [
          { required: true, message: '请选择重置策略', trigger: 'blur' }
        ]
      }
    }
  },
  methods: {

  }

}
</script>

<style lang="scss">
</style>
